/**
 * 
 */
package s2h.controller;

import org.hibernate.classic.Session;

import s2h.hibernate.util.HibernateUtil;
import s2h.model.DepartmentModel;

/**
 * @author WIN7
 *
 */
public class DepartmentController {
	
	public DepartmentModel add(DepartmentModel departModel)
	{
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		session.save(departModel);
		session.getTransaction().commit();
		return departModel;
	}
	public void createDepartments()
	{
		DepartmentModel departModel = new DepartmentModel();
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		session.save(departModel);
		session.getTransaction().commit();
		
	}

}
